package com.useeinfo.oa.modules.base.entity;

import com.useeinfo.framework.extend.entity.SuperClassEntity;
import com.useeinfo.oa.modules.base.enums.MessageTypeEnum;
import com.useeinfo.oa.modules.security.entity.SystemUser;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * @Auther: xudong.sun
 * @Date: 2019/1/18 09:15
 * @Description:计划推送消息表
 */
@Entity
@Table(name = "PlanMessageSend")
public class PlanMessageSend extends SuperClassEntity<PlanMessageSend> {

    /**
     * 单号
     */
    private String orderCode;

    /**
     * 消息通知标题
     */
    private String title;
    /**
     * 消息内容
     */
    @Column(length = 500)
    private String content;

    /**
     * 发送给人员
     */
    @ManyToOne
    @JoinColumn(name = "send_to_user_id")
    private SystemUser sendToUser;

    /**
     * 消息类型
     */
    @Enumerated(value = EnumType.STRING)
    @Column(name = "message_type")
    private MessageTypeEnum messageTypeEnum;

    /**
     * 发送时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendDate;

    /**
     * 所属企业
     */
    @ManyToOne
    @JoinColumn(name = "enterprise_id")
    private Enterprise enterprise;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public SystemUser getSendToUser() {
        return sendToUser;
    }

    public void setSendToUser(SystemUser sendToUser) {
        this.sendToUser = sendToUser;
    }

    public MessageTypeEnum getMessageTypeEnum() {
        return messageTypeEnum;
    }

    public void setMessageTypeEnum(MessageTypeEnum messageTypeEnum) {
        this.messageTypeEnum = messageTypeEnum;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Date getSendDate() {
        return sendDate;
    }

    public void setSendDate(Date sendDate) {
        this.sendDate = sendDate;
    }

    public Enterprise getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(Enterprise enterprise) {
        this.enterprise = enterprise;
    }
}
